import apis from "../../http/apis/apis.js";

export default {
    namespaced: true,
    state: {
        ordersAdmData: [],
    },
    mutations: {
        setStudents(state, data) {
            state.ordersAdmData = data
        }
    },
    actions: {
        //订单渲染
        async getsOrders(context, result) {
            let data = await apis.orders.getsOrders();
            if (data.code) {
                context.commit('setStudents', data.data);
                console.log(data);
                console.log(111);
            }
        },
        //修改订单
        async confirmAlterOrders(context, result) {
            let data = await apis.orders.confirmAlterOrders(result);
            return data;
        },
        //删除订单
        async deleteOrders(context, _id) {
            return await apis.orders.deleteOrders(_id)
        }
    }
}